package com.yuanfeng.base.controller;

import com.yuanfeng.base.dto.ManageFormatDeteteDTO;
import com.yuanfeng.base.dto.ManageGoodsFormatQueryDTO;
import com.yuanfeng.base.dto.MerchantGoodsFormatDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName BaseFormatController
 * @Description
 * @Author liulh
 * @Date 2023/8/11 14:27
 * @Version 1.0
 **/
@RestController
@RequestMapping("/base/format")
public class BaseFormatController extends BaseController {

    /**
     * 查询店铺关联板式
     *
     * @param param
     * @return
     */
    @PostMapping("/query/list")
    public ResponseResult queryGoodsFormat(@RequestBody ManageGoodsFormatQueryDTO param) {
        return baseFormatService.queryGoodsFormat(param);
    }

    /**
     * 更新或删除店铺关联板式
     *
     * @param param
     * @return
     */
    @PostMapping("/add")
    public ResponseResult updateGoodsFormat(@RequestBody MerchantGoodsFormatDTO param) {
        return baseFormatService.updateGoodsFormat(param);
    }

    /**
     * 删除店铺关联板式
     *
     * @param param
     * @return
     */
    @PostMapping("/delete")
    public ResponseResult deleteByFormatId(@RequestBody ManageFormatDeteteDTO param) {
        return baseFormatService.deleteByFormatId(param);
    }
}
